﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ABELGX
{
    /// <summary>
    /// PageWater.xaml 的交互逻辑
    /// </summary>
    public partial class PageWater : Page
    {
        public Car Car { get; private set; }
        public PageWater()
        {
            InitializeComponent();
        }
        public void SetCar(Car car)
        {
            Car = car;
            if (Car == null)
            {
                return;
            }
            new ButtonVM(WaterUp, ButtonVMType.Press, Car.CmdWater.Up, Car.CmdWater.Up);
            new ButtonVM(WaterDown, ButtonVMType.Press, Car.CmdWater.Down, Car.CmdWater.Down);
            new ButtonVM(WaterLeft, ButtonVMType.Press, Car.CmdWater.Left, Car.CmdWater.Left);
            new ButtonVM(WaterRight, ButtonVMType.Press, Car.CmdWater.Right, Car.CmdWater.Right);
            new ButtonVM(WaterFog, ButtonVMType.Press, Car.CmdWater.Fog, Car.CmdWater.Fog);
            new ButtonVM(WaterFlow, ButtonVMType.Press, Car.CmdWater.Flow, Car.CmdWater.Flow);
            new ButtonVM(WaterAuto, ButtonVMType.Press, Car.CmdWater.Auto, Car.CmdWater.Auto);
            new ButtonVM(WaterStop, ButtonVMType.Press, Car.CmdWater.Stop, Car.CmdWater.Stop);

            new ButtonVM(PTZUp, ButtonVMType.Press, Car.CmdPTZ.Up, Car.CmdPTZ.Up);
            new ButtonVM(PTZDown, ButtonVMType.Press, Car.CmdPTZ.Down, Car.CmdPTZ.Down);
            new ButtonVM(PTZLeft, ButtonVMType.Press, Car.CmdPTZ.Left, Car.CmdPTZ.Left);
            new ButtonVM(PTZRight, ButtonVMType.Press, Car.CmdPTZ.Right, Car.CmdPTZ.Right);
            new ButtonVM(ZoomIn, ButtonVMType.Press, Car.CmdPTZ.ZoomIn, Car.CmdPTZ.ZoomIn);
            new ButtonVM(ZoomOut, ButtonVMType.Press, Car.CmdPTZ.ZoomOut, Car.CmdPTZ.ZoomOut);
        }
    }
}
